﻿<Window x:Class="USMC.Net.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="USMC.Net" Height="630" Width="836" WindowStartupLocation="CenterScreen"
        xmlns:local="clr-namespace:USMC.Net" Background="#FFAAB5BD" KeyDown="Window_KeyDown" MouseWheel="Window_MouseWheel" Closed="Window_Closed" Deactivated="Window_Deactivated" >
    
    <Window.Resources>
        <ResourceDictionary Source="Dictionary1.xaml">
        </ResourceDictionary>
    </Window.Resources>
    <Grid Name="mainGrid" HorizontalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="10" Width="589*" />
            <ColumnDefinition Width="203" MinWidth="5"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Menu Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" IsMainMenu="True">
            <MenuItem Header="Файл" Name="fileItem">
                <MenuItem Header="Создать" Name="createItem" />
                <MenuItem Header="Открыть" Name="openItem" />
                <Separator/>
                <MenuItem Header="Сохранить..." Name="savItem" />
                <MenuItem Header="Сохранить как" Name="saveAsItem" />
                <Separator/>
                <MenuItem Header="Последние файлы" Name="latFilesItem" />
                <Separator/>
                <MenuItem Header="Выход" Click="MenuItem_Click" Name="exitItem" />
            </MenuItem>
            <MenuItem Header="Правка" Name="editItem">
                <MenuItem Header="Шаг вперед" Name="undoItem" />
                <MenuItem Header="Шаг назад" Name="redoItem" />
                <Separator/>
                <MenuItem Header="Вырезать" Name="cutItem" />
                <MenuItem Header="Скопировать" Name="copyItem" />
                <MenuItem Header="Встваить" Name="pasteItem" />
                <MenuItem Header="Удалить" Name="removeItem" />
            </MenuItem>
            <MenuItem Header="Вид" Name="viewItem">
                <MenuItem Header="Сетка" Name="gridItem" Click="gridItem_Click" />
                <MenuItem Header="Лог" Name="logItem" IsCheckable="True" IsChecked="False" Click="logItem_Click" />
                <MenuItem Header="Текущее положение" Name="showCurrentItem" Click="showCurrentItem_Click" IsCheckable="True" IsChecked="True"/>
            </MenuItem>
            <MenuItem Header="Инструменты" Name="toolsItem">
                <MenuItem Header="Запуск" Name="startItem" Click="startItem_Click" />
                <MenuItem Header="Стоп" Name="stopMenuItem" Click="stopMenuItem_Click" />
                <MenuItem Header="Перезапустить MicroSMC.exe" Click="restartMicroSMC_Click" />
                <MenuItem Header="Калибровка" Click="MenuItem_Click_2" />
                <MenuItem Header="Параметры" Click="MenuItem_Click_1" />
            </MenuItem>
            <MenuItem Header="Перемещение">
                <MenuItem Header="В начало" Name="toStartMenuItem" Click="toStartMenuItem_Click" />
                <MenuItem Header="В указанную точку" Name="toSpecifiedPoint"/>
            </MenuItem>
        </Menu>
        <TabControl Name="tabControl1"  Grid.Column="1" Grid.Row="1" MouseLeave="tabControl1_MouseLeave" HorizontalAlignment="Stretch" MinWidth="200" Background="{StaticResource {x:Static SystemColors.ControlBrushKey}}">
            <TabItem Header="Маршрут" Name="routTabItem" MouseDoubleClick="routTabItem_MouseDoubleClick" HorizontalAlignment="Stretch">
                <Grid Name="controlsGrid">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                        <StackPanel Name="elementsStackPanel">
                            <Label>Элементы</Label>
                            <Button Background="Transparent" BorderBrush="Transparent" Click="Button_Click">
                                <StackPanel Name="baseLineItem" Orientation="Horizontal" HorizontalAlignment="Stretch">
                                    <Line X1="0" X2="20" Y1="0" Y2="20" Stroke="Black" StrokeThickness="1" Margin="5,3,5,0"/>
                                    <Label HorizontalAlignment="Center" Margin="5,0,5,0">Прямая</Label>
                                </StackPanel>
                            </Button>
                            <Button Background="Transparent" BorderBrush="Transparent" Click="Button_Click_1">
                                <StackPanel  Name="loopItem" Orientation="Horizontal" HorizontalAlignment="Stretch">
                                    <Rectangle Width="28" Height="28" Stroke="Black"/>
                                    <Label Margin="5,0,5,0">Прямоугольная область</Label>
                                </StackPanel>
                            </Button>
                        </StackPanel>
                    </ScrollViewer>
                    <Grid Name="propertiesPanel" Grid.Row="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Label Grid.Row="0">Свойства</Label>
                        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden" Name="lineScrollViewer" Grid.Row="1" Width="{Binding ElementName=propertiesPanel, Path=ActualWidth}">
                            <StackPanel>
                                <Expander Header="Прямоугольник" Name="rectangleExpander" Visibility="Collapsed">
                                    <StackPanel>
                                        <Grid  Width="{Binding ElementName=lineScrollViewer, Path=ViewportWidth}" HorizontalAlignment="Left">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="0.6*"/>
                                                <ColumnDefinition Width="0.4*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>
                                            <TextBlock Focusable="False" ToolTip="Высота" TextWrapping="Wrap" Padding="3" Background="White">Высота</TextBlock>
                                            <TextBlock Grid.Column="1" Grid.Row="0" Name="rectangleHeightTextBox" Background="White"/>
                                            <TextBlock Grid.Column="0" Grid.Row="1" Focusable="False" Padding="3" TextWrapping="Wrap">Ширина</TextBlock>
                                            <TextBlock Grid.Column="1" Grid.Row="1" Name="rectangleWidthTextBox"/>
                                            <TextBlock Grid.Column="0" Grid.Row="2" Focusable="False" Padding="3" TextWrapping="Wrap" Background="White">Проход</TextBlock>
                                            <ComboBox Grid.Column="1" Grid.Row="2" Name="rectDirectionComboBox" Background="White">
                                                <ComboBox.Items>
                                                    <ComboBoxItem>Горизонтальный</ComboBoxItem>
                                                    <ComboBoxItem>Вертикальный</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>
                                            <TextBlock Grid.Column="0" Grid.Row="3" Focusable="False" Padding="3" TextWrapping="Wrap">Интервал</TextBlock>
                                            <TextBox Grid.Column="1" Grid.Row="3" Name="rectIntTextBox" KeyDown="lineTextBox_KeyDown" Background="{Binding ElementName=rectangleWidthTextBox, Path=Background}" />
                                            <GridSplitter VerticalAlignment="Stretch" HorizontalAlignment="Right" Grid.Column="0" Grid.RowSpan="10" Width="3" Background="{Binding Source={StaticResource splittersBrush}}"/>
                                        </Grid>
                                        <Button HorizontalAlignment="Center" Content="Сетка" Name="gridRectButton" Click="gridRectButton_Click" />
                                    </StackPanel>
                                </Expander>
                                <Expander Header="Общее" Name="commonPrtsExpander" Visibility="Collapsed">
                                    <StackPanel>
                                        <Grid  Width="{Binding ElementName=lineScrollViewer, Path=ViewportWidth}" HorizontalAlignment="Left">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="0.6*"/>
                                                <ColumnDefinition Width="0.4*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>
                                            <TextBox IsReadOnly="True" Focusable="False" IsTabStop="False" IsUndoEnabled="False" ToolTip="Координата X точки" TextWrapping="Wrap">X</TextBox>
                                            <TextBox Grid.Column="1" Grid.Row="0" Name="xTextBox" KeyDown="lineTextBox_KeyDown"/>
                                            <TextBox Grid.Column="0" Grid.Row="1" IsReadOnly="True"  Focusable="False" IsTabStop="False" IsUndoEnabled="False" ToolTip="Координата Y точки" TextWrapping="Wrap">Y</TextBox>
                                            <TextBox Grid.Column="1" Grid.Row="1" Name="yTextBox" KeyDown="lineTextBox_KeyDown"/>
                                            <TextBox Grid.Column="0" Grid.Row="2" IsReadOnly="True"  Focusable="False" IsTabStop="False" IsUndoEnabled="False" ToolTip="Делитель координаты" TextWrapping="Wrap">Делитель</TextBox>
                                                <ComboBox Name="divisorComboBox" Grid.Column="1" Grid.Row="2" Background="White" BorderBrush="White" Margin="0" Padding="1" KeyDown="lineTextBox_KeyDown">
                                                    <ComboBoxItem Content="1" />
                                                    <ComboBoxItem Content="2" />
                                                    <ComboBoxItem Content="4" />
                                                    <ComboBoxItem Content="8" />
                                                </ComboBox>
                                                <TextBox Grid.Column="0" Grid.Row="3" IsReadOnly="True">Скорость</TextBox>
                                                <TextBox Grid.Column="1" Grid.Row="3" Name="speedTextBox" KeyDown="lineTextBox_KeyDown"/>
                                                <TextBox Grid.Column="0" Grid.Row="4" IsReadOnly="True" Focusable="False" IsTabStop="False" IsUndoEnabled="False" TextWrapping="WrapWithOverflow">Пауза по завершении</TextBox>
                                                <TextBox Grid.Column="1" Grid.Row="4" Name="pauseTextBox" KeyDown="lineTextBox_KeyDown"/>
                                                <GridSplitter VerticalAlignment="Stretch" HorizontalAlignment="Right" Grid.Column="0" Grid.RowSpan="10" Width="3" Background="{Binding Source={StaticResource splittersBrush}}"/>
                                            </Grid>
                                        </StackPanel>
                                    </Expander>
                                <Expander Header="Синхронизация" Name="synchronizationExpander" Visibility="Collapsed">
                                    <Grid Width="{Binding ElementName=lineScrollViewer, Path=ViewportWidth}" HorizontalAlignment="Left">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="0.6*"/>
                                            <ColumnDefinition Width="0.4*"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <TextBox Grid.Column="0" Grid.Row="0" IsReadOnly="True"  Focusable="False" IsTabStop="False" IsUndoEnabled="False" TextWrapping="Wrap">Ожидание внешнего синхроимпульса</TextBox>
                                        <ComboBox Name="syncrInComboBox" Grid.Column="1" Grid.Row="0" Background="White" BorderBrush="White" Margin="0" Padding="1"  KeyDown="lineTextBox_KeyDown">
                                            <ComboBoxItem Content="Включено" />
                                            <ComboBoxItem Content="Отключено" />
                                        </ComboBox>
                                        <TextBox Grid.Column="0" Grid.Row="1" IsReadOnly="True" Focusable="False" IsTabStop="False" IsUndoEnabled="False" TextWrapping="Wrap">Сброс счетчика внутренних синхроимпульсов</TextBox>
                                        <ComboBox Name="syncrOutRComboBox" Grid.Column="1" Grid.Row="1" Background="White" BorderBrush="White" Margin="0" Padding="1" KeyDown="lineTextBox_KeyDown">
                                            <ComboBoxItem Content="Включено" />
                                            <ComboBoxItem Content="Отключено" />
                                        </ComboBox>
                                    <GridSplitter VerticalAlignment="Stretch" HorizontalAlignment="Right" Grid.Column="0" Grid.RowSpan="10" Width="3" Background="{Binding Source={StaticResource splittersBrush}}"/>
                                </Grid>
                                    </Expander>
                                <Expander Header="Мертвый ход и плавный пуск" Name="backlashExpander" Visibility="Collapsed">
                                    <Grid Width="{Binding ElementName=lineScrollViewer, Path=ViewportWidth}" HorizontalAlignment="Center">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="0.6*"/>
                                            <ColumnDefinition Width="0.4*"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <TextBox Grid.Column="0" Grid.Row="0" IsReadOnly="True" Focusable="False" IsTabStop="False" IsUndoEnabled="False" TextWrapping="Wrap">Плавный пуск</TextBox>
                                        <ComboBox Name="slowStartComboBox" Grid.Column="1" Grid.Row="0" Background="White" BorderBrush="White" Margin="0" Padding="1" SelectionChanged="slowStartComboBox_SelectionChanged" KeyDown="lineTextBox_KeyDown">
                                            <ComboBoxItem Content="Включен" />
                                            <ComboBoxItem Content="Отключен" />
                                        </ComboBox>
                                        <TextBox Grid.Column="0" Grid.Row="1" IsReadOnly="True" Focusable="False" IsTabStop="False" IsUndoEnabled="False" TextWrapping="Wrap">Мертвый ход (авт.)</TextBox>
                                        <ComboBox Name="autoBackLashComboBox" Grid.Column="1" Grid.Row="1" Background="White" BorderBrush="White" Margin="0" Padding="1" SelectionChanged="autoBackLashComboBox_SelectionChanged" KeyDown="lineTextBox_KeyDown">
                                            <ComboBoxItem Content="Включен" />
                                            <ComboBoxItem Content="Отключен" />
                                        </ComboBox>
                                        <TextBox Grid.Column="0" Grid.Row="2" IsReadOnly="True" Focusable="False" IsTabStop="False" IsUndoEnabled="False" TextWrapping="Wrap">Мертвый ход по X</TextBox>
                                        <ComboBox Name="xBLDirComboBox" Grid.Column="1" Grid.Row="2" Background="White" BorderBrush="White" Margin="0" Padding="1" SelectionChanged="autoBackLashComboBox_SelectionChanged" KeyDown="lineTextBox_KeyDown">
                                            <ComboBoxItem Content="Вправо" />
                                            <ComboBoxItem Content="Влево" />
                                        </ComboBox>
                                        <TextBox Grid.Column="0" Grid.Row="3" IsReadOnly="True" Focusable="False" IsTabStop="False" IsUndoEnabled="False" TextWrapping="Wrap">Мертвый ход по Y</TextBox>
                                        <ComboBox Name="yBLDirComboBox" Grid.Column="1" Grid.Row="3" Background="White" BorderBrush="White" Margin="0" Padding="1" SelectionChanged="autoBackLashComboBox_SelectionChanged" KeyDown="lineTextBox_KeyDown">
                                            <ComboBoxItem Content="Вверх" />
                                            <ComboBoxItem Content="Вниз" />
                                        </ComboBox>
                                        <TextBox Grid.Column="0" Grid.Row="4" IsReadOnly="True" Focusable="False" IsTabStop="False" IsUndoEnabled="False" TextWrapping="Wrap">Принудительный мертвый ход</TextBox>
                                        <ComboBox Name="forceLoftComboBox" Grid.Column="1" Grid.Row="4" Background="White" BorderBrush="White" Margin="0" Padding="1" SelectionChanged="autoBackLashComboBox_SelectionChanged" KeyDown="lineTextBox_KeyDown">
                                            <ComboBoxItem Content="Включен" />
                                            <ComboBoxItem Content="Отключен" />
                                        </ComboBox>
                                        <GridSplitter VerticalAlignment="Stretch" HorizontalAlignment="Right" Grid.Column="0" Grid.RowSpan="10" Width="3" Background="{Binding Source={StaticResource splittersBrush}}"/>
                                    </Grid>
                                </Expander>
                                <Button HorizontalAlignment="Center" Name="okButton" Click="okButton_Click" Visibility="Collapsed">Принять</Button>
                            </StackPanel>
                            </ScrollViewer>
                    </Grid>
                    <GridSplitter Grid.Row="1" VerticalAlignment="Top"  HorizontalAlignment="Stretch" Height="3" Background="{StaticResource splittersBrush}"/>
                </Grid>
            </TabItem>
            <TabItem Name="deviceTabItem" Header="Устройство" MouseDoubleClick="deviceTabItem_MouseDoubleClick" HorizontalAlignment="Stretch">
                <ScrollViewer Name="deviceScrollView" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" Width="{Binding}">
                    <Grid VerticalAlignment="Stretch" ClipToBounds="True">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Expander Header="Состояние" Grid.Row="0" Grid.Column="0" Name="stateExpander" HorizontalAlignment="Stretch">
                            <Grid Name="stateGrid" HorizontalAlignment="Stretch">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.6*" MinWidth="40"/>
                                    <ColumnDefinition Width="0.4*" MinWidth="40"/>
                                </Grid.ColumnDefinitions>
                                <GridSplitter Name="stateGridSplitter" Grid.Column="0" HorizontalAlignment="Right" Width="2" Background="{Binding Source={StaticResource splittersBrush}}" />
                            </Grid>
                        </Expander>
                    <Expander Grid.Row="1" Header="Энкодер" Name="encoderExpander" HorizontalAlignment="Stretch" Visibility="Collapsed">
                            <Grid Name="encoderGrid" HorizontalAlignment="Stretch">
                            <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.6*" MinWidth="40"/>
                                    <ColumnDefinition Width="0.4*" MinWidth="40"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Column="0" Grid.Row="0" TextWrapping="Wrap" Focusable="False" AllowDrop="False" Background="White">Текущая позиция</TextBlock>
                                <TextBlock Grid.Column="1" Grid.Row="0" TextWrapping="Wrap" Name="EncoderPosTextBox" Focusable="False" AllowDrop="False" Background="White"/>
                            <TextBlock Grid.Column="0" Grid.Row="1" TextWrapping="Wrap" Focusable="False" AllowDrop="False">Текущая позиция (в шагах энкодера)</TextBlock>
                            <TextBlock Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Name="ECurPosTextBox" Focusable="False" AllowDrop="False" />
                            <GridSplitter Name="encoderGridSplitter" Grid.Column="0" Grid.RowSpan="2" HorizontalAlignment="Right" Width="2" Background="{Binding Source={StaticResource splittersBrush}}" />
                        </Grid>
                    </Expander>
                        <Expander Grid.Row="2" Header="Режим" Name="modeExpander" Expanded="modeExpander_Expanded" HorizontalAlignment="Stretch"
                                  Visibility="Collapsed">
                            <Grid Name="modeGrid" HorizontalAlignment="Stretch">
                            <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.6*" MinWidth="40"/>
                                    <ColumnDefinition Width="0.4*" MinWidth="40"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Button Name="refreshModeButton" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" Click="refreshModeButton_Click">Обновить</Button>
                            <Button Name="applyModeButton" Grid.Row="100" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" Click="applyModeButton_Click">Применить</Button>
                            <GridSplitter Name="modeGridSplitter" Grid.Row="1" Grid.RowSpan="1" Grid.Column="0" HorizontalAlignment="Right"  Width="2" Background="{Binding Source={StaticResource splittersBrush}}" />
                        </Grid>
                    </Expander>
                        <Expander Header="Параметры" Grid.Row="3" Name="parametersExpande" Expanded="parametersExpande_Expanded" HorizontalAlignment="Stretch">
                            <Grid Name="parametersGrid" HorizontalAlignment="Stretch">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.6*" MinWidth="40"/>
                                    <ColumnDefinition Width="0.4*" MinWidth="40"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Button Name="refreshParamButton" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" Click="refreshParamButton_Click">Обновить</Button>
                                <Button Name="applyParamButton" Grid.Row="100" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" Click="applyParamButton_Click">Применить</Button>
                                <GridSplitter Name="paramGridSplitter" Grid.Row="1" Grid.RowSpan="1" Grid.Column="0" HorizontalAlignment="Right"  Width="2" Background="{Binding Source={StaticResource splittersBrush}}" />
                            </Grid>
                        </Expander>
                    </Grid>
                </ScrollViewer>
            </TabItem>
            <TabItem Name="cyclesTabItem" Header="Циклы" Visibility="Collapsed">
                <StackPanel MaxHeight="{Binding ElementName=tabControl1, Path=ActualHeight}">
                    <local:windowedList HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="cyclesList" SelectionChanged="cyclesList_SelectionChanged"></local:windowedList>
                    <Button HorizontalAlignment="Center" Name="closeCyclesButton" Click="closeCyclesButton_Click">Закрыть</Button>
                </StackPanel>
            </TabItem>
        </TabControl>
        <StackPanel Grid.Row="1" Grid.Column="2">
            <Button Name="routeinStackButton" Content="Маршрут" Visibility="Collapsed" MouseDoubleClick="routeinStackButton_MouseDoubleClick" Click="routeinStackButton_Click">
                <Button.LayoutTransform>
                    <RotateTransform Angle="-90"/>
                </Button.LayoutTransform>
            </Button>
            <Button Name="deviceinStackButton" Content="Устройство" Visibility="Collapsed" MouseDoubleClick="deviceinStackButton_MouseDoubleClick" Click="deviceinStackButton_Click">
                <Button.LayoutTransform>
                    <RotateTransform Angle="-90"/>
                </Button.LayoutTransform>
            </Button>
        </StackPanel>
        <StatusBar Grid.Row="3" Grid.ColumnSpan="3">
            <StatusBarItem Content="Состояние устройства:" />
            <StatusBarItem Content="not defined" Name="deviceStateBarItem" />
            <Separator/>
            <StatusBarItem Content="Температура:" />
            <StatusBarItem Content="0"  Name="temperatureBarItem"/>
            <StatusBarItem Content="градусов"/>
            <Separator/>
            <StatusBarItem Content="Текущая позиция:" />
            <StatusBarItem Name="currentPositionBarItem"  Content="not defined" />
        </StatusBar>
        <local:RouteCanvas x:Name="canvas" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" LostFocus="canvas_LostFocus" />
        <GridSplitter Grid.Row="1" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Left" Width="3" Background="{StaticResource splittersBrush}" Name="splitter1" Margin="0,0,3,0" />
        <TextBox Name="logTextBox"  Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" IsReadOnly="True" Focusable="False" Visibility="Collapsed" TextWrapping="Wrap" IsTabStop="False" IsUndoEnabled="False" Margin="2" />
        <GridSplitter Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Name="logGridSplitter" Height="2" Background="{StaticResource splittersBrush}" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
    </Grid>
</Window>
